﻿using System;
using System.Collections.Generic;
using System.Text;
using Studio.Network.Utilities;
using System.Drawing;
using Studio.Network.Kaixin001.Entities;
using Studio.Foundation.Text;
using Studio.Foundation.Json.Core.Conversion;
using System.Text.RegularExpressions;
using System.Threading;

namespace Studio.Network.Kaixin001
{

    public partial class HouseAPI
    {
        public static readonly string URL_DOJOB = "http://www.kaixin001.com/house/dojob.php?verify={0}&petid={1}";

        public static readonly string URL_DOJOB_REFER = "http://www.kaixin001.com/app/app.php?aid=1062&url=jobslist.php";


        // roomid=15552&verify=252314_1062_252314_1229613057_b8d612f6c884f7c548d190ec4614ae5a&houseid=669&myroomid=9717 
        // roomid=9717&verify=252314_1062_252314_1229613057_b8d612f6c884f7c548d190ec4614ae5a&houseid=630&myroomid=15552
        public static readonly string URL_UPDATE_HOUSE = "http://www.kaixin001.com/house/updatehouse.php?roomid={0}&verify={1}&houseid={2}&myroomid={3}";

        public static readonly string URL_UPDATE_HOUSE_REFER = "http://www.kaixin001.com/house/updatehouse_dialog2.php";

        /// <summary>
        /// Do Job
        /// </summary>
        public static string DoJob(string verify, int petid)
        {
            string url = string.Format(URL_DOJOB, verify, petid);
            HttpHelper http = KXInterface.HttpTransportation();
            string response = http.GET(url, URL_DOJOB_REFER);
            return response;
        }

        public static string UpdateHouse(string verify, int houseid, int roomid, int myroomid)
        {
            string url = string.Format(URL_UPDATE_HOUSE, roomid, verify, houseid, myroomid);
            HttpHelper http = KXInterface.HttpTransportation();
            string response = http.POST(url, URL_UPDATE_HOUSE_REFER);
            return response;
        }


    }
}
